﻿using Yto.Entities.Record;
using Microsoft.AspNet.Identity;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Yto.Core.Users
{
    [Table("USERSINFO")]
    public abstract class UserBase : FullEntity<long>, IUser<long>
    {
        public const int MAXUSERNAMELENGTH = 32;

        public const int MAXEMAILADDRESSLENTH = 256;

        [Required]
        [StringLength(MAXUSERNAMELENGTH)]
        [Column("USERNAME")]
        public virtual string UserName { get; set; }

        [Required]
        [StringLength(MAXEMAILADDRESSLENTH)]
        [Column("EMAILADDRESS")]
        public virtual string EmailAddress { get; set; }

        [Column("LASTLOGINTIME")]
        public virtual DateTime? LastLoginTime { get; set; }
    }
}
